﻿<?php
$time=time().'000';
$ip=get_real_ip();
$sign=bin2hex(aes128Encrypt('159951',"timestamp=".$time."&ip=".$ip));
function aes128Encrypt($key, $data) {
    $padding = 16 - (strlen($data) % 16);
    $data=str_pad($data,strlen($data) + 16 - strlen($data) % 16,chr($padding));
    $keySize   = 16;
    $ivSize    = 16;
    $rawKey = $key;
    $genKeyData = '';
    do
    {
        $genKeyData = $genKeyData.md5( $genKeyData.$rawKey,true);
    } while(
            strlen( $genKeyData ) < 32
    );
    $generatedKey = substr($genKeyData, 0, $keySize );
    $generatedIV  = substr($genKeyData, 16, 16);
    return openssl_encrypt($data,'aes-128-cbc', $generatedKey, OPENSSL_NO_PADDING, $generatedIV);
}
function get_real_ip(){
	$ip=false;
	if(!empty($_SERVER["HTTP_CLIENT_IP"])){
		$ip = $_SERVER["HTTP_CLIENT_IP"];
	}
	if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
		$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
		if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
		for ($i = 0; $i < count($ips); $i++) {
			if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) {
				$ip = $ips[$i];
				break;
			}
		}
	}
	return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}
?>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>dplayer+ckplayer</title>
</head>
<link rel="stylesheet" type="text/css" href="/player/dplayer/DPlayer.min.css">
<link rel="stylesheet" type="text/css" href="/player/css/share.css">
<body>
	<div class="video" id="mvideo"></div>	
	<script type="text/javascript" src="/player/dplayer/hls.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="/player/dplayer/DPlayer.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="/player/ckplayer/ckplayer.js" charset="utf-8"></script>
	<script type="text/javascript" src="/player/js/jquery-1.11.2.min.js" charset="utf-8"></script>
	<script src="/player/js/m3u8-parser.min.js"></script>
	<script type="text/javascript" src="/player/js/index.js" charset="utf-8"></script>
	<script type="text/javascript">		
		var main = "https://player.api.xin/20190904/ubATBCor/index.m3u8?sign=<?php echo $sign;?>"; //m3u8地址
		var xml = ""
		var pic = ""
		var videoid = "video";
		var box = "mvideo";
		var playertype = "dplayer" ; //如果需要强制ckplayer则改为ckplayer
		var t = BrowserType();		
		
		if (t && t.indexOf("IE") >= 0  )
			playertype = "ckplayer"		
		init();
	</script>
</body>
</html>